package com.topisv.tms.rest.qimen.command;


import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import com.topisv.tms.exception.PaiUException;
import com.topisv.tms.rest.qimen.command.IQMRequestCommand;
import com.topisv.tms.rest.qimen.command.QMRequestCommandContainer;
import com.topisv.tms.rest.qimen.qmservice.ReturnInstorageCreateService;
import com.topisv.tms.rest.qimen.request.RequestMethodType;
import com.topisv.tms.rest.qimen.request.RequestParams;
import com.topisv.tms.rest.qimen.response.ResponseParams;

@Component
@Lazy(false)
public class ReturnInstorageCreateCommand implements IQMRequestCommand, InitializingBean {

	@Autowired
	private ReturnInstorageCreateService returnInstorageCreateService;
	
	@Override
	public void afterPropertiesSet() throws Exception {
		QMRequestCommandContainer.getInstance().add(RequestMethodType.RETURNORDER_CREATE.getType(), this);		
	}

	@Override
	public ResponseParams execute(RequestParams params) throws PaiUException {
		return returnInstorageCreateService.execute(params);
	}

	@Override
	public void executeBefore(ResponseParams qmResponse) throws PaiUException {
	}

}
